import login from '../components/login/login';
import home from '../components/home/home';
import adList from '../components/ad/ad';
import addAd from '../components/ad/add';
import client from '../components/client/client';
import newClient from '../components/client/newClient';
import editClient from '../components/client/editClient';
import adData from '../components/data/adData';
import custData from '../components/data/custData';
import finRecord from '../components/finance/finRecord';
import balance from '../components/finance/balance';
import allocation from '../components/finance/allocation';
import accountsMess from '../components/accounts/accountsMess';
import safety from '../components/accounts/safety';
import error404 from '../components/error/404';

const routes = [{
    path: '/',
    name: 'login',
    component: login
  },
  {
    path: '/home',
    name: 'home',
    component: home,
    children: [{
        path: 'ad',
        name: 'ad',
        meta: {
          requireAuth: true
        },
        component: adList
      },
      {
        path: 'ad/add',
        name: 'addAd',
        meta: {
          requireAuth: true
        },
        component: addAd
      },
      {
        path: 'client',
        name: 'client',
        meta: {
          requireAuth: true
        },
        component: client
      },
      {
        path: 'client/newClient',
        name: 'newClient',
        meta: {
          requireAuth: true
        },
        component: newClient
      },
      {
        path: 'client/editClient/:id',
        name: 'editClient',
        meta: {
          requireAuth: true
        },
        component: editClient
      },
      {
        path: 'data/adData',
        name: 'adData',
        meta: {
          requireAuth: true
        },
        component: adData
      },
      {
        path: 'data/custData',
        name: 'custData',
        meta: {
          requireAuth: true
        },
        component: custData
      },
      {
        path: 'finance/finRecord',
        name: 'finRecord',
        meta: {
          requireAuth: true
        },
        component: finRecord
      },
      {
        path: 'finance/balance',
        name: 'balance',
        meta: {
          requireAuth: true
        },
        component: balance
      },
      {
        path: 'finance/allocation',
        name: 'allocation',
        meta: {
          requireAuth: true
        },
        component: allocation
      },
      {
        path: 'accounts/accountsMess',
        name: 'accountsMess',
        meta: {
          requireAuth: true
        },
        component: accountsMess
      },
      {
        path: 'accounts/safety',
        name: 'safety',
        meta: {
          requireAuth: true
        },
        component: safety
      }
    ]
  },
  {
    path: '*',
    name: 'error404',
    component: error404
  }
];

export default routes;
